﻿#ifndef CTagButton_H
#define CTagButton_H
/********************************************************************************
** @ Date:2024/05/11
** @ Author: AoZhiQiang
** @ Description:  自定义标签按钮控件
** @ Version:1.0.0
** @ Fun:
********************************************************************************/
#include <QWidget>
#include <QPushButton>

class CTagButton  : public QPushButton
{
	Q_OBJECT

public:
	CTagButton(QWidget *parent = nullptr);
	~CTagButton();

	QString getId();    //获得按钮的ID
	void setIsTagVisible(bool bShowTag);

protected:
	/**
	* @brief paintEvent 绘制事件
	* @param event 设置绘制事件对象
	*/
	void paintEvent(QPaintEvent *event) override;

private:
	void initUI();
	void initData();

public slots:
	/**
	* @brief slotSetTagVisible 设置标签可见性
	* @param
	*/
	void slotSetTagVisible(QString sButtonId, bool bVisible);

private slots:
	/**
	* @brief slotSetTag 设置按钮的标签
	* @param
	*/
	void slotSetTag();

private:
	QString m_sButtonId;           //按钮Id
	bool m_bShowTag;               //是否显示标签
};

#endif